package org.dromara.mall.domain.vo;

import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.mall.domain.TerMallProduct;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;



/**
 * 商品视图对象 ter_mall_product
 *
 * @author xch
 * @date 2025-06-27
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = TerMallProduct.class)
public class TerMallProductVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ExcelProperty(value = "")
    private Long id;

    /**
     * 分类ID
     */
    @ExcelProperty(value = "分类ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "ter_category")
    private Long categoryId;

    /**
     * 商品名称
     */
    @ExcelProperty(value = "商品名称")
    private String name;

    /**
     * 价格
     */
    @ExcelProperty(value = "价格")
    private Integer price;

    /**
     * 库存
     */
    @ExcelProperty(value = "库存")
    private Integer stock;

    /**
     * 缩略图URL
     */
    @ExcelProperty(value = "缩略图URL")
    private String thumbnail;

    /**
     * 缩略图URLUrl
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "thumbnail")
    private String thumbnailUrl;
    /**
     * 详情图URL（JSON数组）
     */
    @ExcelProperty(value = "详情图URL", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "J=SON数组")
    private String images;

    /**
     * 详情图URL（JSON数组）Url
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "images")
    private String imagesUrl;
    /**
     * 商品描述
     */
    @ExcelProperty(value = "商品描述")
    private String description;

    /**
     * 销量
     */
    @ExcelProperty(value = "销量")
    private Integer sales;

    /**
     * 状态(0=上架,1=下架)
     */
    @ExcelProperty(value = "状态(0=上架,1=下架)", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "yes_no_status")
    private Integer status;

    /**
     * 是否热销
     */
    @ExcelProperty(value = "是否热销", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "yes_no_status")
    private Integer isHot;

    /**
     * 轮播图
     */
    @ExcelProperty(value = "轮播图")
    private String carouselImage;

    /**
     * 轮播图Url
     */
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "carouselImage")
    private String carouselImageUrl;
    private Integer version;

    private Integer quantity;
    private Integer selected;
    private Long cartId;
}
